# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Simon Sapin <simon dot sapin at exyr dot org>
# Contributor: Kyle Keen <keenerd@gmail.com>

pkgname=python-wsproto
pkgver=1.2.0
pkgrel=2
pkgdesc="WebSockets state-machine based protocol implementation"
url="https://github.com/python-hyper/wsproto"
license=('MIT')
arch=('any')
depends=('python-h11')
makedepends=('python-setuptools')
checkdepends=('python-pytest-runner')
source=("https://pypi.io/packages/source/w/wsproto/wsproto-$pkgver.tar.gz")
sha512sums=('43270687a1cfb5f35423c527de5b9db7ee2ddf27d416f47358386c1c94dc3f836a601f300bf66441c4b90130e6e6f502fb29dfeb2374dd76aefa19cfbb70a372')

build() {
  cd wsproto-$pkgver
  python setup.py build
}

check() {
  cd wsproto-$pkgver
  python setup.py pytest
}

package() {
  cd wsproto-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
